#include "WriteToFile.h"

std::ofstream file;

WriteToFile::WriteToFile()
{
	file.open(FILENAME);
	writeHeader();
	writeArrays();
	file.close();
}

WriteToFile::~WriteToFile(void)
{
}

void WriteToFile::writeHeader(){
	Bild *a=Bild::getInstance();
	file << HEAD;
	file << a->width << " " << a->height << " \n";
	file << a->max << " \n";
}
void WriteToFile::writeArrays(){
	Bild *a=Bild::getInstance();

		for(int j=0; j< a->width*a->height;j++)
		{
			file << a->r[j] << " " << a->g[j] << " " << a->b[j] << " ";
		}
}
